Crate floating_ui_dom
source ·Expand description
Rust port of Floating UI.
This is the library to use Floating UI on the web, wrapping floating_ui_core
with DOM interface logic.
See @floating-ui/dom for the original package.
Re-exports§
pub use floating_ui_utils::dom;
pub use floating_ui_utils::AlignedPlacement;
pub use floating_ui_utils::Alignment;
pub use floating_ui_utils::Axis;
pub use floating_ui_utils::ClientRectObject;
pub use floating_ui_utils::Coords;
pub use floating_ui_utils::Dimensions;
pub use floating_ui_utils::ElementRects;
pub use floating_ui_utils::Length;
pub use floating_ui_utils::Padding;
pub use floating_ui_utils::PartialSideObject;
pub use floating_ui_utils::Placement;
pub use floating_ui_utils::Rect;
pub use floating_ui_utils::Side;
pub use floating_ui_utils::SideObject;
pub use floating_ui_utils::Strategy;
pub use floating_ui_utils::VirtualElement;
Structs§
- State passed to
SizeOptions::apply
. - Data stored by
Arrow
middleware. - Options for
Arrow
. - Data stored by
AutoPlacement
middleware. - An overflow stored in
AutoPlacementData
. - Options for
AutoPlacement
middleware. - Options for
auto_update
. - Options for
compute_position
. - Return of
compute_position
. - Default
Limiter
, which doesn’t limit shifting. - Options for
detect_overflow
. - Data stored by
Flip
middleware. - An overflow stored in
FlipData
. - Options for
Flip
middleware. - Data stored by
Hide
middleware. - Options for
Hide
middleware. - Options for
Inline
. - Axes configuration for
LimitShiftOffset
. - Options for
LimitShift
limiter. - Data stored by middleware.
- Return of
Middleware::compute
. - State passed to
Middleware::compute
. - Data stored by
Offset
middleware. - Axes configuration for
OffsetOptions
. - Data stored by
Shift
middleware. - Options for
Shift
middleware. - Options for
Size
middleware.
Enums§
- Fallback strategy used by
Flip
middleware. - Fallback strategy used by
Hide
middleware. - Offset configuration for
LimitShiftOptions
. - Options for
Offset
middleware.
Constants§
- Name of the
Arrow
middleware. - Name of the
AutoPlacement
middleware. - Name of the
Flip
middleware. - Name of the
Hide
middleware. - Name of the
Inline
middleware. - Name of the
Offset
middleware. - Name of the
Shift
middleware. - Name of the
Size
middleware.
Traits§
- Middleware used by
compute_position
. - Middleware with options.
Functions§
- Automatically updates the position of the floating element when necessary. Should only be called when the floating element is mounted on the DOM or visible on the screen.
- Computes the
x
andy
coordinates that will place the floating element next to a given reference element.
Type Aliases§
- Provides data to position an inner element of the floating element so that it appears centered to the reference element.
- Optimizes the visibility of the floating element by choosing the placement that has the most space available automatically, without needing to specify a preferred placement. Alternative to
Flip
. - Optimizes the visibility of the floating element by flipping the
placement
in order to keep it in view when the preferred placement(s) will overflow the clipping boundary. Alternative toAutoPlacement
. - Provides data to hide the floating element in applicable situations, such as when it is not in the same clipping context as the reference element.
- Provides improved positioning for inline reference elements that can span over multiple lines, such as hyperlinks or range selections.
- Vector of middleware used in
ComputePositionConfig
. - Modifies the placement by translating the floating element along the specified axes.
- Optimizes the visibility of the floating element by shifting it in order to keep it in view when it will overflow the clipping boundary.
- Provides data that allows you to change the size of the floating element - for instance, prevent it from overflowing the clipping boundary or match the width of the reference element.